home *** CD-ROM | disk | FTP | other *** search
- /* MainWindow.c */
- /* Created 7/8/93 2:33 PM by AppMaker */
-
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Controls.h>
- #include <Dialogs.h>
- #include <Events.h>
- #include <Lists.h>
- #include <Menus.h>
- #include <Resources.h>
- #include <TextEdit.h>
- #include <ToolUtils.h>
- #include "ResourceDefs.h"
- #include "Globals.h"
- #include "Miscellany.h"
- #include "Scrolling.h"
- #include "WindowAids.h"
- #include "AppspritesData.h"
- #include "MainWindow.h"
-
-
-
- /*----------*/
- void OpenMainWindow (Str255 fName,
- short vRefNum,
- short fRefNum)
- {
- WindowPtr newWindow;
- Rect bounds;
-
- newWindow = GetWindow (MainWindowID);
- if (fName [0] != 0) {
- SetWTitle (newWindow, fName);
- }
-
- InitializeMasters(3);
-
- if (CheckSystem())
- {
- SetPort (newWindow);
- SetNewInfo (newWindow);
- cur->vScroll = nil;
- cur->hScroll = nil;
- cur->fileNum = fRefNum;
- cur->volNum = vRefNum;
- cur->dirty = false;
- cur->filename = NewString (fName);
- cur->windowKind = WMainWindow;
- ((WindowPeek) curWindow)->windowKind = userKind + WMainWindow;
- cur->witlHandle = GetResource ('Witl', MainWindowID);
- cur->wictHandle = GetResource ('Wict', MainWindowID);
-
-
- cur->text = nil;
-
- for (cur->spriteNum = 0; cur->spriteNum < kNumberOfSprites; cur->spriteNum++)
- {
- cur->moveSpeedArray[cur->spriteNum] = 0;
- }
-
- cur->SetAllSpeeds = 1;
-
- ShowWindow (newWindow);
-
- PrepareSimpleAnimation();
- }
-
- } /*OpenMainWindow*/
-
- /*----------*/
- void CloseMainWindow (void)
- {
-
- EndSimpleAnimation();
- DisposHandle ((Handle) cur->filename);
- DiscardInfo (curWindow);
- } /*CloseMainWindow*/
-
- /*----------*/
- void ControlMainWindow (ControlHandle whichControl,
- short whichPart,
- Point where)
- {
- Rect bounds;
-
-
- } /*ControlMainWindow*/
-
- /*----------*/
- void MouseInMainWindow (Point where,
- short modifiers)
- {
- Rect bounds;
-
- PerformSimpleAnimation();
-
- } /*MouseInMainWindow*/
-
- /*----------*/
- void TypeInMainWindow (char ch)
- {
- if (cur->text == nil) {
- SysBeep (1);
- } else {
- TEKey (ch, cur->text);
- cur->dirty = true;
- }
- } /*TypeInMainWindow*/
-
- /*----------*/
- void UpdateMainWindow (void)
- {
- Rect bounds;
-
- ChangeMoveSpeed();
- PerformSimpleAnimation();
-
- DrawClippedGrow (-15, -15);
- } /*UpdateMainWindow*/
-
- /*----------*/
- void ActivateMainWindow (Boolean activate)
- {
- ChangeMoveSpeed();
- PerformSimpleAnimation();
-
- DrawClippedGrow (-15, -15);
- } /*ActivateMainWindow*/
-
- /*----------*/
- void ResizeMainWindow (void)
- {
- /* application-specific code to resize items in window */
-
- EndSimpleAnimation();
- PrepareSimpleAnimation();
-
- } /*ResizeMainWindow*/
-
- /*----------*/
- pascal void ScrollMainWindow (short newValue,
- short oldValue)
- {
- /* application-specific code to scroll window */
- } /*ScrollMainWindow*/
-
- /* MainWindow */
-